#include<bits/stdc++.h>

using namespace std;

int a[10]={0,1,2,3,4,5,6,7,8,9};
queue<int> q;

int main(){
    for(int i=0;i<10;i++)
        q.push(a[i]);
    int k;
    cin>>k;
    for(int i=0;i<10-k;i++){
        q.push(q.front());
        q.pop();
    }
    while(!q.empty()){
        cout<<q.front()<<" ";
        q.pop();
    }    
    return 0;
}